﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Hosting;
using System.IO;

namespace BulldogCMS.Core.MVC
{
    public class ResourceVirtualFile : VirtualFile
    {
        private string m_path;
        
        public ResourceVirtualFile(string virtualPath) : base(virtualPath) {
            m_path = VirtualPathUtility.ToAppRelative(virtualPath);
        }

        public override System.IO.Stream Open() {
            return Context.ResourceFilesHelper.GetResourceStream(this.m_path);
        } 

    }
}